tool button: Add element names for tool item subclasses
authorMatthias Clasen <mclasen@redhat.com>
Thu, 5 Nov 2015 20:41:37 +0000 (15:41 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 5 Nov 2015 20:41:37 +0000 (15:41 -0500)
Add the obvious names to the CSS nodes of GtkRadioToolButton,
GtkToggleToolButton and GtkSeparatorToolItem.

gtk/gtkradiotoolbutton.c
gtk/gtkseparatortoolitem.c
gtk/gtktoggletoolbutton.c

index 860abd94d3cb90997b2871df1817b3c62e8d53c9..c7519c29ad972dbc319e2dfaa735ec3e9dcb8f04 100644 (file)
  * that is, a button that is part of a group of toggle buttons where only
  * one button can be active at a time.
  *
- * Use gtk_radio_tool_button_new() to create a new
- * #GtkRadioToolButton. Use gtk_radio_tool_button_new_from_widget() to
- * create a new #GtkRadioToolButton that is part of the same group as an
- * existing #GtkRadioToolButton.
+ * Use gtk_radio_tool_button_new() to create a new GtkRadioToolButton. Use
+ * gtk_radio_tool_button_new_from_widget() to create a new GtkRadioToolButton
+ * that is part of the same group as an existing GtkRadioToolButton.
+ *
+ * # CSS nodes
+ *
+ * GtkRadioToolButton has a single CSS node with name toolbutton.
  */
 
 
index e92ed403822ab2fa7785d3a695c35cf1a46b8f05..087370002f1e9df142c36d98367ad3011411feba 100644 (file)
  * a “spring” that forces other items to the ends of the toolbar.
  *
  * Use gtk_separator_tool_item_new() to create a new #GtkSeparatorToolItem.
+ *
+ * # CSS nodes
+ *
+ * GtkSeparatorToolItem has a single CSS node with name separator.
  */
 
 #define MENU_ID "gtk-separator-tool-item-menu-id"
@@ -145,20 +149,17 @@ gtk_separator_tool_item_class_init (GtkSeparatorToolItemClass *class)
                                                          P_("Whether the separator is drawn, or just blank"),
                                                          TRUE,
                                                          GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+
+  gtk_widget_class_set_css_name (widget_class, "separator");
 }
 
 static void
 gtk_separator_tool_item_init (GtkSeparatorToolItem *separator_item)
 {
-  GtkStyleContext *context;
-
   separator_item->priv = gtk_separator_tool_item_get_instance_private (separator_item);
   separator_item->priv->draw = TRUE;
 
   gtk_widget_set_has_window (GTK_WIDGET (separator_item), FALSE);
-
-  context = gtk_widget_get_style_context (GTK_WIDGET (separator_item));
-  gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
 }
 
 static void
@@ -173,7 +174,7 @@ gtk_separator_tool_item_create_menu_proxy (GtkToolItem *item)
 {
   GtkWidget *menu_item = NULL;
   
-  menu_item = gtk_separator_menu_item_new();
+  menu_item = gtk_separator_menu_item_new ();
   
   gtk_tool_item_set_proxy_menu_item (item, MENU_ID, menu_item);
   
index 5cd0f8804e44625ee3c46c2c89e91332befbbdbc..9a3722c6d1ff04855628e6c961a0b1545c27f64c 100644 (file)
  * A #GtkToggleToolButton is a #GtkToolItem that contains a toggle
  * button.
  *
- * Use gtk_toggle_tool_button_new() to create a new
- * #GtkToggleToolButton.
+ * Use gtk_toggle_tool_button_new() to create a new GtkToggleToolButton.
+ *
+ * # CSS nodes
+ *
+ * GtkToggleToolButton has a single CSS node with name togglebutton.
  */